﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SupportLibrary.WebMethod
{
   public class WebControl
    {
        private string _id;
        private string _page;
        private string _controlname;
        private string _tagname;
        private string _attributevalue;
        private string _xpath;
        private IWebmethod _webmethod;

        public WebControl(IWebmethod webmethod,string id,string page,string controlName,string tagName,string attributeValue,string xpath)
        {
            _webmethod = webmethod;
            _id = id;
            _page = page;
            _controlname = controlName;
            _tagname = tagName;
            _attributevalue = attributeValue;
            _xpath = xpath;
        }



        public string ID {
            get { return _id; }
            set { _id = value; }
        }

        public string Page { get { return _page; } set { _page = value; } }

        public string ControlName { get { return _controlname; } set { _controlname = value; } }
        public string TagName { get { return _tagname; } set { _tagname = value; } }
        public string AttributeValue { get { return _attributevalue; } set { _attributevalue = value; } }
        public string Xpath { get { return _xpath; } set { _xpath = value; } }

        public bool isValid()
        {
            if (_id == null || _page == null || _tagname == null)
                return false;
            if (_id.Equals("") || _page.Equals("") || _tagname.Equals(""))
                return false;
            if (_controlname == null)
                _controlname = "";
            if (_xpath == null)
                _xpath = "";
            if (_attributevalue == null)
                _attributevalue = "";
            return true;
        }

    }
}
